/*
 * main.cpp
 *
 *  Created on: Nov 14, 2016
 *      Author: swolice
 */

#include <dlfcn.h>
#include <mysql/mysql.h>
#include <stdio.h>

int main(int argc, char **argv) {
	int ret=0;
	MYSQL mysql;
	MYSQL *con=NULL;

	con=mysql_init(&mysql);
	if(con==NULL)
	{
		ret=mysql_errno(&mysql);
		printf("func mysql_init() err: %d\n", ret);
		return ret;
	}

	con=mysql_real_connect(&mysql,"localhost","root", "ting2jun", "tess", 0, NULL, 0);
	if(con==NULL)
	{
		ret=mysql_errno(&mysql);
		printf("func mysql_real_connect() err :%d\n", ret);
		return ret;
	} else {
		printf("func mysql_real_connect() ok\n");
	}
	mysql_close(&mysql);
	return ret;
}



